<template>
    <div>
        <el-form>
            <el-form-item label="护士姓名">
                <el-select  v-model="form.nurse" value-key="id"  style="width: 200px;" @change="changeSelect">
                    <el-option  v-for="item in cache.nurseData" :key="item.id"  :value="item" :label="item.name"></el-option>
                </el-select>
            </el-form-item>
        </el-form>
        <el-table :data="table.rowsData" stripe border  v-loading="option.loading">
            <el-table-column prop="useVolunteeName" label="义工" sortable min-width="80"></el-table-column>
            <el-table-column prop="linkProviderName" label="浆员" sortable min-width="80"></el-table-column>
            <el-table-column prop="address" label="家庭住址" sortable min-width="160"></el-table-column>
            <el-table-column prop="round1" label="01" sortable min-width="40"></el-table-column>
            <el-table-column prop="round2" label="02" sortable min-width="40"></el-table-column>
            <el-table-column prop="round3" label="03" sortable min-width="40"></el-table-column>
            <el-table-column prop="round4" label="04" sortable min-width="40"></el-table-column>
            <el-table-column prop="round5" label="05" sortable min-width="40"></el-table-column>
            <el-table-column prop="round6" label="06" sortable min-width="40"></el-table-column>
            <el-table-column prop="round7" label="07" sortable min-width="40"></el-table-column>
            <el-table-column prop="round8" label="08" sortable min-width="40"></el-table-column>
            <el-table-column prop="round9" label="09" sortable min-width="40"></el-table-column>
            <el-table-column prop="round10" label="10" sortable min-width="40"></el-table-column>
            <el-table-column prop="round11" label="11" sortable min-width="40"></el-table-column>
            <el-table-column prop="round12" label="12" sortable min-width="40"></el-table-column>
            <el-table-column prop="round13" label="13" sortable min-width="40"></el-table-column>
            <el-table-column prop="round14" label="14" sortable min-width="40"></el-table-column>
            <el-table-column prop="round15" label="15" sortable min-width="40"></el-table-column>
            <el-table-column prop="round16" label="16" sortable min-width="40"></el-table-column>
            <el-table-column prop="round17" label="17" sortable min-width="40"></el-table-column>
            <el-table-column prop="round18" label="18" sortable min-width="40"></el-table-column>
            <el-table-column prop="round19" label="19" sortable min-width="40"></el-table-column>
            <el-table-column prop="round20" label="20" sortable min-width="40"></el-table-column>
            <el-table-column prop="round21" label="21" sortable min-width="40"></el-table-column>
            <el-table-column prop="round22" label="22" sortable min-width="40"></el-table-column>
            <el-table-column prop="round23" label="23" sortable min-width="40"></el-table-column>
            <el-table-column prop="round24" label="24" sortable min-width="40"></el-table-column>
            <el-table-column prop="round25" label="25" sortable min-width="40"></el-table-column>
            <el-table-column prop="round26" label="26" sortable min-width="40"></el-table-column>
            <el-table-column prop="total" label="截止上轮总量" sortable min-width="110"></el-table-column>
        </el-table>
    </div>
</template>
<script>
import analysisHttp from 'plugins/axios/analysisHttp.js';
import bloodSourcesHttp from 'plugins/axios/bloodSourcesHttp.js';
export default {
    data(){
        return {
            isSum:true,
            option:{
                loading:false,
            },
            cache:{
                nurseData:[],
            },
            form:{
                nurse:null,
            },
            table:{
                rowsData:[],
            }
        }
    },
    created(){},
    mounted(){
        let self = this;
        self.init();
    },
    methods:{
        //初始化
        init(){
            let self = this;
            self.initCache();
        },
        initCache(){
            let self = this;
            self.initNurse();
        },
        initNurse(){
            let self = this;
            //所有护士信息 此处依赖统计模块的查询所有护士接口，如果该处报错或护士信息未查询到，请核对统计模块后端接口是否启动
            analysisHttp.getAllNurse({isCollNurse:false}).then(res=>{
                self.cache.nurseData = res.content;
            });
        },
        //查询数据
        queryTable(){
            let self = this;
            let param = {
                useNurseId:self.form.nurse.id
            }
            bloodSourcesHttp.getVolunteeDetailInfo(param).then(res=>{
                self.table.rowsData = res.content;
                self.option.loading = false;
            });
        },
        changeSelect(){
            let self = this;
            self.queryTable();
        },
    }
}
</script>
<style scoped>
.el-table{
overflow:visible !important;
}
</style>